package pers.cj.pdos.service;

import com.baomidou.mybatisplus.extension.service.IService;
import pers.cj.pdos.entity.*;
import pers.cj.pdos.vo.HouseOutVo;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author chenj
 * @since 2020-02-21
 */
public interface IHouseOutService extends IService<HouseOut> {
    boolean checkNo(String no, String companyId);

    void insert(HouseOut houseOut, List<HouseOutGoods> houseOutGoodsList, List<GoodsSn> goodsSnList, List<GoodsSnLog> goodsSnLogList,
                List<HouseOutPacket> houseOutPacketList,List<HouseOutPacketGoods> houseOutPacketGoodsList);

    List<HouseOutVo> listVo(String companyId,
                            Integer page,
                            Integer limit,
                            Boolean close,
                            Integer type,
                            String search,
                            String no,
                            String linkNo,
                            String goodsName,
                            String remark,
                            String unitName,
                            Date makeTime1,
                            Date makeTime2,
                            String makeUserId,
                            String userStoreId,
                            String userId,
                            Date date1,
                            Date date2,
                            String storeId,
                            String houseId);

    long count(String companyId,
               Boolean close,
               Integer type,
               String search,
               String no,
               String linkNo,
               String goodsName,
               String remark,
               String unitName,
               Date makeTime1,
               Date makeTime2,
               String makeUserId,
               String userStoreId,
               String userId,
               Date date1,
               Date date2,
               String storeId,
               String houseId);

    HouseOutVo getVoById(String id);

    List<HouseOutVo> listVoByIds(List<String> ids);


    List<HouseOutVo> listVoByHouseWaitOut(String houseWaitOutId);

    void close(HouseOut houseOut);

    /**
     * 其他单据关闭之前检查是否有未关闭的出库单
     * @param linkId 关联单号
     * @return
     */
    boolean checkByLinkId(String linkId);

    /**
     * 检查是否已关闭
     * @param houseOut
     * @return
     */
    boolean checkClose(HouseOut houseOut);
}
